<?php
 include_once('connection/connection.php');
	$data=$_GET['data'];
    $val=$_GET['val'];
		function getName($colName,$id)
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}
 if($data=='district')
	 {
          echo "<select name='district' id='district' class='txt' onChange=\"changeForm('show')\">\n";
          echo "<option value='0'>==== District ====</option>\n";
          $result=mysql_query("select DISTINCT district_id from tbl_dtls_q3_loc");
          while(list($id)=mysql_fetch_array($result))
		  {
               echo "<option value=\"$id\">".getName('district',$id)."</option> \n" ;
          }
		  echo "</select>";    
	 }
	 
	if($data=='show')
	 {
          echo "<input type='submit' value='View' id='form_id' name='submit' style='border:1px solid #000000; font-size: 8pt; font-family: Verdana;'>";
	 }
	
		
?>
